import sys
import main
import time
import random
import threading

class test(threading.Thread):
    def __init__(self, name, port):
        threading.Thread.__init__(self)
        self._name = name
        self._port = port

    def run(self):
        p = main.main("p" + str(self._name), random.randint(1, 10), self._port)
        
name = 2
port = 5991
for i in range(3):
    t = test(name, port)
    t.start()
    sys.stdin.write("hello 127.0.0.1:5990")
    name += 1
    port += 1
    time.sleep(3)

while 1:
    pass
